﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _06继承与多态案例
{
    class Pistol : Weapon
    {
        //子类中新增的字段
        private string _starLevel;//手枪星级
        public Pistol(string name, int mc, int an, float fireRate, float dis,string star = "☆") : base(name, mc, an, fireRate, dis)
        {
            _starLevel = star;
        }

        public override void Fire()
        {
            base.Fire();//调用基类的开火方法
            Console.WriteLine("手枪开火了:一颗子弹崩射而出!");
            PrintWeaponStatus();
        }

        public override void PrintWeaponStatus()
        {
            base.PrintWeaponStatus();
            Console.WriteLine("等级:{0}", _starLevel);
            Console.WriteLine("------------------End------------");
        }
    }
}
